package com.zhenmaitang.clinic_sys.entity;

import io.swagger.v3.oas.annotations.media.Schema;

/**
 * 角色数据权限关联实体类 - 角色与数据权限的关联关系
 */
@Schema(description = "角色数据权限关联实体", example = "角色权限关联信息")
public class RoleDataScope {
    @Schema(description = "角色ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer roleId;
    
    @Schema(description = "数据权限ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer dataScopeId;
    
    @Schema(description = "自定义数据范围(JSON格式)", example = "{\"deptIds\":[1,2,3]}", type = "string", format = "json")
    private String customScope;  // 自定义数据范围，如部门ID列表等，JSON格式存储

    // 构造函数
    public RoleDataScope() {}

    public RoleDataScope(Integer roleId, Integer dataScopeId) {
        this.roleId = roleId;
        this.dataScopeId = dataScopeId;
    }

    public RoleDataScope(Integer roleId, Integer dataScopeId, String customScope) {
        this.roleId = roleId;
        this.dataScopeId = dataScopeId;
        this.customScope = customScope;
    }

    // Getter和Setter方法
    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }

    public Integer getDataScopeId() {
        return dataScopeId;
    }

    public void setDataScopeId(Integer dataScopeId) {
        this.dataScopeId = dataScopeId;
    }

    public String getCustomScope() {
        return customScope;
    }

    public void setCustomScope(String customScope) {
        this.customScope = customScope;
    }

    @Override
    public String toString() {
        return "RoleDataScope{" +
                "roleId=" + roleId +
                ", dataScopeId=" + dataScopeId +
                ", customScope='" + customScope + '\'' +
                '}';
    }
}